package com.adcc.ags.msgStore;

import com.fasterxml.jackson.annotation.JsonProperty;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

/**
 * 数据库连接配置工厂
 */
public class DBConnectionFactory {
    //数据库连接用户名
    @NotNull
    private String username;
    //数据库连接密码
    @NotNull
    private String password;
    //数据库连接url
    @NotNull
    private String url;
    //驱动类名称
    @NotNull
    private String driverClassName;
    //数据库连接池初始值
    @Min(0)
    @Max(1024)
    private int initSize;
    //数据库连接池保持活动最小值
    @Min(0)
    @Max(1024)
    private int minSize;
    //数据库连接池最大连接数
    @Min(0)
    @Max(1024)
    private int maxSize;
    //数据库连接的最大空闲时间
    @Min(0)
    @Max(10000)
    private int maxIdleTime;

    @JsonProperty("username")
    public String getUsername() {
        return username;
    }

    @JsonProperty("username")
    public void setUsername(String username) {
        this.username = username;
    }

    @JsonProperty("password")
    public String getPassword() {
        return password;
    }

    @JsonProperty("password")
    public void setPassword(String password) {
        this.password = password;
    }

    @JsonProperty("url")
    public String getUrl() {
        return url;
    }

    @JsonProperty("url")
    public void setUrl(String url) {
        this.url = url;
    }

    @JsonProperty("driverClassName")
    public String getDriverClassName() {
        return driverClassName;
    }

    @JsonProperty("driverClassName")
    public void setDriverClassName(String driverClassName) {
        this.driverClassName = driverClassName;
    }

    @JsonProperty("initSize")
    public int getInitSize() {
        return initSize;
    }

    @JsonProperty("initSize")
    public void setInitSize(int initSize) {
        this.initSize = initSize;
    }

    @JsonProperty("minSize")
    public int getMinSize() {
        return minSize;
    }

    @JsonProperty("minSize")
    public void setMinSize(int minSize) {
        this.minSize = minSize;
    }

    @JsonProperty("maxSize")
    public int getMaxSize() {
        return maxSize;
    }

    @JsonProperty("maxSize")
    public void setMaxSize(int maxSize) {
        this.maxSize = maxSize;
    }

    @JsonProperty("maxIdleTime")
    public int getMaxIdleTime() {
        return maxIdleTime;
    }

    @JsonProperty("maxIdleTime")
    public void setMaxIdleTime(int maxIdleTime) {
        this.maxIdleTime = maxIdleTime;
    }

}
